torque.panels['client'] = new Ext.FormPanel({
    width:'1000',
    labelWidth:100,
    frame:false,
    bodyStyle:{padding:'5px 5px 0',
        borderBottom:'1px #aaa solid'},
    title: 'Client',
    iconCls: 'icon-client',
    labalAlign: 'top',
    autoScroll:true,
    layout:'column',
    items: [
        {
        columnWidth:.5,
        layout:'form',
        border:false,
        style:{marginTop:'16px'},
        items: [{
            text: 'test',
            html: '<div align="center" style="margin:10px"><img src="/resources/images/icons/clients/'+torque.client.slug+'.png"/><br /><span style="font-size:20px">'+torque.client.name+' '+torque.client.version+'</span></div>',
            width: '100%',
        },{
            xtype:'fieldset',
            title:'Defaults',
            hideLabel:false,
            labelWidth:150,
            items: [{
                xtype:'spinnerfield',
                fieldLabel: 'Stop Seed Ratio',
                name: 'stop_seed_ratio',
                minValue: 0.5,
                maxValue: 20,
                incrementValue: .1,
                allowDecimals: true,
                id:'client_opt_stop_seed_ratio',
                width:100
            },{
                xtype:'checkbox',
                fieldLabel: 'Stop Seed at Ratio',
                name: 'stop_seed_at_ratio',
                id:'client_opt_stop_seed_at_ratio',
                width:250
            },{
                xtype:'checkbox',
                fieldLabel: 'Remove Torrent at Ratio',
                name: 'remove_seed_at_ratio',
                id:'client_opt_remove_seed_at_ratio',
                width:250
            },{
                xtype:'checkbox',
                fieldLabel: 'Add Paused',
                name: 'add_paused',
                id:'client_opt_add_paused',
                width:250
            }]
        },{
            xtype:'fieldset',
            title:'Connections, Throttling and Bandwidth',
            hideLabel:false,
            labelWidth:250,
            items: [{
                xtype:'spinnerfield',
                fieldLabel: 'Max Active Downloading',
                name: 'max_active_downloading',
                id:'client_opt_max_active_downloading',
                minValue:-1,
                maxValue:500,
                allowDecimals:false,
                incrementValue:1,
                accelerate:false,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Active Limit',
                name: 'max_active_limit',
                id:'client_opt_max_active_limit',
                minValue:-1,
                maxValue:500,
                allowDecimals:false,
                incrementValue:1,
                accelerate:false,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Active Seeding',
                name: 'max_active_seeding',
                id:'client_opt_max_active_seeding',
                minValue:-1,
                maxValue:250,
                allowDecimals:false,
                incrementValue:1,
                accelerate:false,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Connections Global',
                name: 'max_connections_global',
                id:'client_opt_max_connections_global',
                minValue:-1,
                maxValue:1000,
                allowDecimals:false,
                incrementValue:1,
                accelerate:false,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Connections per Second',
                name: 'max_connections_per_second',
                id:'client_opt_max_connections_per_second',
                minValue:-1,
                maxValue:200,
                allowDecimals:false,
                incrementValue:1,
                accelerate:false,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Connections per Torrent',
                name: 'max_connections_per_torrent',
                id:'client_opt_max_connections_per_torrent',
                minValue:-1,
                maxValue:250,
                allowDecimals:false,
                incrementValue:1,
                accelerate:false,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Download Speed',
                name: 'max_download_speed',
                id:'client_opt_max_download_speed',
                minValue:-1,
                allowDecimals:true,
                incrementValue:0.1,
                accelerate:true,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Download Speed per Torrent',
                name: 'max_download_speed_per_torrent',
                id:'client_opt_max_download_speed_per_torrent',
                minValue:-1,
                allowDecimals:true,
                incrementValue:0.1,
                accelerate:true,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Half Open Connnections',
                name: 'max_half_open_connections',
                id:'client_opt_max_half_open_connections',
                minValue:-1,
                maxValue:250,
                allowDecimals:false,
                incrementValue:1,
                accelerate:true,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Upload Slots Global',
                name: 'max_upload_slots_global',
                id:'client_opt_max_upload_slots_global',
                minValue:-1,
                maxValue:250,
                allowDecimals:false,
                incrementValue:1,
                accelerate:true,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Upload Slots Per Torrent',
                name: 'max_upload_slots_per_torrent',
                id:'client_opt_max_upload_slots_per_torrent',
                minValue:-1,
                maxValue:50,
                allowDecimals:false,
                incrementValue:1,
                accelerate:true,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Upload Speed',
                name: 'max_upload_speed',
                id:'client_opt_max_upload_speed',
                minValue:-1,
                allowDecimals:true,
                incrementValue:0.1,
                accelerate:true,
                width:100
            },{
                xtype:'spinnerfield',
                fieldLabel: 'Max Upload Speed per Torrent',
                name: 'max_upload_speed_per_torrent',
                id:'client_opt_max_upload_speed_per_torrent',
                minValue:-1,
                allowDecimals:true,
                incrementValue:0.1,
                accelerate:true,
                width:100
            }]
        }]
    },{
        columnWidth:.5,
        layout:'form',
        border:false,
        bodyStyle:'padding:10px',
        items: [{
            xtype:'fieldset',
            title:'Ports',
            hideLabel:false,
            labelWidth:150,
            items: [{
                    xtype:'spinnerfield',
                    fieldLabel: 'Daemon',
                    name: 'daemon_port',
                    id:'client_opt_daemon_port',
                    minValue:1024,
                    maxValue:65536,
                    allowDecimals:false,
                    incrementValue:1,
                    accelerate:false,
                    width:100
                },{
                    xtype:'checkbox',
                    fieldLabel: 'Random Ports',
                    name: 'random_ports',
                    id:'client_opt_random_ports',
                    width:100
                },{  
                xtype: 'fieldset',
                title:'Listen Range',
                items: [{
                    xtype:'spinnerfield',
                    fieldLabel: 'Start',
                    name: 'listen_ports_start',
                    id:'client_opt_listen_ports_start',
                    minValue:1024,
                    maxValue:65536,
                    allowDecimals:false,
                    incrementValue:1,
                    accelerate:false,
                    width:100
                },{
                    xtype:'spinnerfield',
                    fieldLabel: 'End',
                    name: 'listen_ports_end',
                    id:'client_opt_listen_ports_end',
                    minValue:1024,
                    maxValue:65536,
                    allowDecimals:false,
                    incrementValue:1,
                    accelerate:false,
                    width:100
                }]
            },{  
                xtype: 'fieldset',
                title:'Outgoing range',
                items: [{
                    xtype:'spinnerfield',
                    fieldLabel: 'Start',
                    name: 'outgoing_ports_start',
                    id:'client_opt_outgoing_ports_start',
                    minValue:1024,
                    maxValue:65536,
                    allowDecimals:false,
                    incrementValue:1,
                    accelerate:false,
                    width:100
                },{
                    xtype:'spinnerfield',
                    fieldLabel: 'End',
                    name: 'outgoing_ports_end',
                    id:'client_opt_outgoign_ports_end',
                    minValue:1024,
                    maxValue:65536,
                    allowDecimals:false,
                    incrementValue:1,
                    accelerate:false,
                    width:100
                }]
            }]
        },{
            xtype:'fieldset',
            title:'Paths',
            hideLabel:false,
            labelWidth:150,
            items: [{
                xtype:'textfield',
                fieldLabel: 'Download Location',
                name: 'download_location',
                id:'client_opt_download_location',
                width:250
            },{
                xtype:'textfield',
                fieldLabel: 'Torrent File Location',
                name: 'torrentfiles_location',
                id:'client_opt_torrentfiles_location',
                width:250
            },{
                xtype:'textfield',
                fieldLabel: 'Move Completed Path',
                name: 'move_completed_path',
                id:'client_opt_move_completed_path',
                width:250
            },{
                xtype:'checkbox',
                fieldLabel: 'Move Completed Enabled',
                name: 'move_completed',
                id:'client_opt_move_completed',
                width:250
            },{
                xtype:'textfield',
                fieldLabel: 'Autoadd Location',
                name: 'autoadd_location',
                id:'client_opt_autoadd_location',
                width:250
            },{
                xtype:'checkbox',
                fieldLabel: 'Autoadd Enabled',
                name: 'autoadd_enabled',
                id:'client_opt_autoadd_enabled',
                width:250
            },]
        },{
            xtype:'fieldset',
            title:'Encryption',
            hideLabel:false,
            labelWidth:150,
            items: [{
                xtype:'textfield',
                fieldLabel: 'Level',
                name: 'enc_level',
                id:'client_opt_enc_level',
                width:250
            },{
                xtype:'textfield',
                fieldLabel: 'Incoming',
                name: 'enc_in_policy',
                id:'client_opt_enc_in_policy',
                width:250
            },{
                xtype:'textfield',
                fieldLabel: 'Outgoing',
                name: 'enc_out_policy',
                id:'client_opt_enc_out_policy',
                width:250
            },{
                xtype:'checkbox',
                fieldLabel: 'Prefer RC4',
                name: 'enc_prefer_rc4',
                id:'client_opt_enc_prefer_rc4',
                width:250
            }]
        }]
    }],
    buttons: [{
        text: 'Restore Defaults'
    },{
        text: 'Save'
    }]

});

//torque.panels['client'].render(torque.panels('center'));
